package com.ljcalc.business.components.fetchers;

import java.io.IOException;
import java.net.*;


public abstract class ContentFetcher {

	protected URL url = null;	
	protected boolean goodUrlFormat = true;
	
	public ContentFetcher(String url){
		try {
			this.url = new URL(url);
		} catch (MalformedURLException ex) {
			goodUrlFormat = false;
			ex.printStackTrace();
		}
	}
	
	/**
	 * 
	 * @return number of items fetched
	 * @throws IOException
	 */
	public abstract int loadContent() throws IOException ;
	
	public int hashCode() {
		return toString().hashCode();
	}

}
